<?php
/**
 * --------------------------------------------------------------
 * 菜单模型
 * --------------------------------------------------------------
 * Light Year Doc
 * @author yinq<3331653644@qq.com>
 * --------------------------------------------------------------
 */
namespace app\admin\validate;

use think\Validate;

class Menu extends Validate
{
    // 定义验证规则
    protected $rule = [
        'title|菜单名称' => 'length:1,30',
		'column_id'     => 'requireIf:type,0',
		'page_id'       => 'requireIf:type,1',
		'url|链接地址'   => 'requireIf:type,2',
    ];

    // 定义验证提示
    protected $message = [
        'column_id' => '请选择栏目',
        'page_id'   => '请选择单页',
    ];
}